module.exports = (generator, { features }) => {
  let extraDevDependencied = {};
  let extraDependencied = {};
  if (features.includes("typescript")) {
    extraDevDependencied = {
      "ts-loader": "^9.4.2",
    };
  }
  generator.extendPackage({
    scripts: {
      dev: "webpack-dev-server --config ./build/webpack.dev.js",
      build: "webpack --config ./build/webpack.prod.js",
    },
    devDependencies: {
      "clean-webpack-plugin": "^4.0.0",
      "copy-webpack-plugin": "^11.0.0",
      "css-minimizer-webpack-plugin": "^4.2.2",
      "css-loader": "^6.7.3",
      "html-webpack-plugin": "^5.5.0",
      "mini-css-extract-plugin": "^2.7.2",
      "unplugin-auto-import": "^0.12.1",
      "unplugin-vue-components": "^0.22.12",
      webpack: "^5.75.0",
      "webpack-cli": "^5.0.1",
      "webpack-dev-server": "^4.11.1",

      ...extraDevDependencied,
    },
  });

  generator.render("./template", {
    useTs: features.includes("typescript"),
    useBabel: features.includes("babel"),
  });
};
